<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BrokenIRC: server_src/logs_helpers.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BrokenIRC
   &#160;<span id="projectnumber">0.0.42</span>
   </div>
   <div id="projectbrief">A &#39;not so functionnal&#39; irc server and a WIP client</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_20e5c1c74b8b955148e6b35ac4a0bc4d.html">server_src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">logs_helpers.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="server_8h_source.html">../include/server.h</a>&quot;</code><br />
<code>#include &lt;unistd.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for logs_helpers.c:</div>
<div class="dyncontent">
<div class="center"><img src="logs__helpers_8c__incl.png" border="0" usemap="#server__src_2logs__helpers_8c" alt=""/></div>
<map name="server__src_2logs__helpers_8c" id="server__src_2logs__helpers_8c">
<area shape="rect" id="node2" href="server_8h.html" title="../include/server.h" alt="" coords="150,80,277,107"/>
</map>
</div>
</div>
<p><a href="logs__helpers_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a805324e4c542079956ff84a290274d23"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logs__helpers_8c.html#a805324e4c542079956ff84a290274d23">print_users_in_chans</a> (<a class="el" href="structt__channel.html">t_channel</a> *chanlist, int index)</td></tr>
<tr class="separator:a805324e4c542079956ff84a290274d23"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a45c9c768c2486ac046ac242d3c46aadb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logs__helpers_8c.html#a45c9c768c2486ac046ac242d3c46aadb">print_users</a> (<a class="el" href="structt__userlist.html">t_userlist</a> *list)</td></tr>
<tr class="separator:a45c9c768c2486ac046ac242d3c46aadb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2bcab2bec250f4df132d9cfc8fa070f0"><td class="memItemLeft" align="right" valign="top">static char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logs__helpers_8c.html#a2bcab2bec250f4df132d9cfc8fa070f0">get_host_string</a> (const char *host, const char *service)</td></tr>
<tr class="separator:a2bcab2bec250f4df132d9cfc8fa070f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e2903ce4461ed71cf294dd675bd4c49"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logs__helpers_8c.html#a7e2903ce4461ed71cf294dd675bd4c49">logthisevent</a> (const char etype, <a class="el" href="structt__serv.html">t_serv</a> *all)</td></tr>
<tr class="separator:a7e2903ce4461ed71cf294dd675bd4c49"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a2bcab2bec250f4df132d9cfc8fa070f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2bcab2bec250f4df132d9cfc8fa070f0">&#9670;&nbsp;</a></span>get_host_string()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static char* get_host_string </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>service</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construct the host:service string from struct infos </p><dl class="section note"><dt>Note</dt><dd>this is to avoid sprintf usage </dd></dl>

<p class="definition">Definition at line <a class="el" href="logs__helpers_8c_source.html#l00043">43</a> of file <a class="el" href="logs__helpers_8c_source.html">logs_helpers.c</a>.</p>

<p class="reference">Referenced by <a class="el" href="logs__helpers_8c_source.html#l00059">logthisevent()</a>.</p>
<div class="fragment"><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;{</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <span class="keywordtype">char</span> *usr = malloc((NI_MAXHOST + 1 + NI_MAXSERV) * <span class="keyword">sizeof</span>(*usr));</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        memset(usr, 0, NI_MAXHOST + 1 + NI_MAXSERV);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        strncpy(usr, host, NI_MAXHOST);</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        strcat(usr, <span class="stringliteral">&quot;:&quot;</span>);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        strncat(usr, service, NI_MAXSERV);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <span class="keywordflow">return</span> (usr);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;}</div></div><!-- fragment --><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="logs__helpers_8c_a2bcab2bec250f4df132d9cfc8fa070f0_icgraph.png" border="0" usemap="#logs__helpers_8c_a2bcab2bec250f4df132d9cfc8fa070f0_icgraph" alt=""/></div>
<map name="logs__helpers_8c_a2bcab2bec250f4df132d9cfc8fa070f0_icgraph" id="logs__helpers_8c_a2bcab2bec250f4df132d9cfc8fa070f0_icgraph">
<area shape="rect" id="node2" href="server_8h.html#a7e2903ce4461ed71cf294dd675bd4c49" title="logthisevent" alt="" coords="164,5,256,32"/>
<area shape="rect" id="node3" href="server__main_8c.html#a4178685c6a99dba7611faf9fe58f1a54" title="evhandler" alt="" coords="304,5,383,32"/>
<area shape="rect" id="node4" href="server__main_8c.html#a825c9cedc1751b000c44487b4233c37c" title="getactiveclients" alt="" coords="431,5,544,32"/>
<area shape="rect" id="node5" href="server__main_8c.html#af3e041546aaed3cd242c2b0e77162b39" title="server" alt="" coords="592,5,651,32"/>
<area shape="rect" id="node6" href="server__main_8c.html#a0c99d968a34e803d378692bde2e3f18f" title="main" alt="" coords="699,5,749,32"/>
</map>
</div>

</div>
</div>
<a id="a7e2903ce4461ed71cf294dd675bd4c49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e2903ce4461ed71cf294dd675bd4c49">&#9670;&nbsp;</a></span>logthisevent()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int logthisevent </td>
          <td>(</td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>etype</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structt__serv.html">t_serv</a> *&#160;</td>
          <td class="paramname"><em>all</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Switch type and print data in <a class="el" href="structt__serv.html">t_serv</a> according to a fmt string </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">etype</td><td>the kind of event type in [C]onnect, [D]isconnect or default </td></tr>
    <tr><td class="paramname">all</td><td>the 'catch them all' structure with server infos </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 </dd></dl>

<p class="definition">Definition at line <a class="el" href="logs__helpers_8c_source.html#l00059">59</a> of file <a class="el" href="logs__helpers_8c_source.html">logs_helpers.c</a>.</p>

<p class="reference">References <a class="el" href="server_8h_source.html#l00091">t_serv::buf</a>, <a class="el" href="logs__helpers_8c_source.html#l00043">get_host_string()</a>, <a class="el" href="server_8h_source.html#l00092">t_serv::host</a>, <a class="el" href="server_8h_source.html#l00090">t_serv::nread</a>, and <a class="el" href="server_8h_source.html#l00093">t_serv::service</a>.</p>

<p class="reference">Referenced by <a class="el" href="server__main_8c_source.html#l00043">evhandler()</a>.</p>
<div class="fragment"><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;{</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="keywordtype">char</span> *usr = <a class="code" href="logs__helpers_8c.html#a2bcab2bec250f4df132d9cfc8fa070f0">get_host_string</a>(all-&gt;<a class="code" href="structt__serv.html#a0dd3a9c2648da4fba88a38276803037c">host</a>, all-&gt;<a class="code" href="structt__serv.html#aee509c3823199bf9f0ad285a718260bd">service</a>);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keywordtype">char</span> *c_fmt = <span class="stringliteral">&quot; = &gt; IN: [%zd bytes] FROM: [%s] DATA: [%s]\n&quot;</span>;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        <span class="keywordtype">char</span> *d_fmt = <span class="stringliteral">&quot;USER: [%s] disconnect\n&quot;</span>;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <span class="keywordtype">char</span> *def_fmt = <span class="stringliteral">&quot;Type:%c Size:%zd DATA: [%s]\n&quot;</span>;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        <span class="keywordflow">switch</span> (etype) {</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                <span class="keywordflow">case</span> <span class="charliteral">&#39;c&#39;</span>:</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                        fprintf(stdout, c_fmt, all-&gt;<a class="code" href="structt__serv.html#a85e55e3fe1bfb973e7f5d15a0a436b18">nread</a>, usr, all-&gt;<a class="code" href="structt__serv.html#a005714cf56aaffce970916774cf2b04a">buf</a>);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                        <span class="keywordflow">break</span>;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                <span class="keywordflow">case</span> <span class="charliteral">&#39;d&#39;</span>:</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                        fprintf(stdout, d_fmt, usr);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                        <span class="keywordflow">break</span>;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                <span class="keywordflow">default</span>:</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                        fprintf(stdout, def_fmt, etype, all-&gt;<a class="code" href="structt__serv.html#a85e55e3fe1bfb973e7f5d15a0a436b18">nread</a>, all-&gt;<a class="code" href="structt__serv.html#a005714cf56aaffce970916774cf2b04a">buf</a>);</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                        <span class="keywordflow">break</span>;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        }</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        free(usr);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keywordflow">return</span> (1);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;}</div><div class="ttc" id="structt__serv_html_a005714cf56aaffce970916774cf2b04a"><div class="ttname"><a href="structt__serv.html#a005714cf56aaffce970916774cf2b04a">t_serv::buf</a></div><div class="ttdeci">char buf[BUF_SIZE]</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00091">server.h:91</a></div></div>
<div class="ttc" id="structt__serv_html_a0dd3a9c2648da4fba88a38276803037c"><div class="ttname"><a href="structt__serv.html#a0dd3a9c2648da4fba88a38276803037c">t_serv::host</a></div><div class="ttdeci">char host[NI_MAXHOST]</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00092">server.h:92</a></div></div>
<div class="ttc" id="structt__serv_html_a85e55e3fe1bfb973e7f5d15a0a436b18"><div class="ttname"><a href="structt__serv.html#a85e55e3fe1bfb973e7f5d15a0a436b18">t_serv::nread</a></div><div class="ttdeci">ssize_t nread</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00090">server.h:90</a></div></div>
<div class="ttc" id="structt__serv_html_aee509c3823199bf9f0ad285a718260bd"><div class="ttname"><a href="structt__serv.html#aee509c3823199bf9f0ad285a718260bd">t_serv::service</a></div><div class="ttdeci">char service[NI_MAXSERV]</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00093">server.h:93</a></div></div>
<div class="ttc" id="logs__helpers_8c_html_a2bcab2bec250f4df132d9cfc8fa070f0"><div class="ttname"><a href="logs__helpers_8c.html#a2bcab2bec250f4df132d9cfc8fa070f0">get_host_string</a></div><div class="ttdeci">static char * get_host_string(const char *host, const char *service)</div><div class="ttdef"><b>Definition:</b> <a href="logs__helpers_8c_source.html#l00043">logs_helpers.c:43</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="logs__helpers_8c_a7e2903ce4461ed71cf294dd675bd4c49_cgraph.png" border="0" usemap="#logs__helpers_8c_a7e2903ce4461ed71cf294dd675bd4c49_cgraph" alt=""/></div>
<map name="logs__helpers_8c_a7e2903ce4461ed71cf294dd675bd4c49_cgraph" id="logs__helpers_8c_a7e2903ce4461ed71cf294dd675bd4c49_cgraph">
<area shape="rect" id="node2" href="logs__helpers_8c.html#a2bcab2bec250f4df132d9cfc8fa070f0" title="get_host_string" alt="" coords="145,5,256,32"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="logs__helpers_8c_a7e2903ce4461ed71cf294dd675bd4c49_icgraph.png" border="0" usemap="#logs__helpers_8c_a7e2903ce4461ed71cf294dd675bd4c49_icgraph" alt=""/></div>
<map name="logs__helpers_8c_a7e2903ce4461ed71cf294dd675bd4c49_icgraph" id="logs__helpers_8c_a7e2903ce4461ed71cf294dd675bd4c49_icgraph">
<area shape="rect" id="node2" href="server__main_8c.html#a4178685c6a99dba7611faf9fe58f1a54" title="evhandler" alt="" coords="145,5,224,32"/>
<area shape="rect" id="node3" href="server__main_8c.html#a825c9cedc1751b000c44487b4233c37c" title="getactiveclients" alt="" coords="272,5,385,32"/>
<area shape="rect" id="node4" href="server__main_8c.html#af3e041546aaed3cd242c2b0e77162b39" title="server" alt="" coords="433,5,492,32"/>
<area shape="rect" id="node5" href="server__main_8c.html#a0c99d968a34e803d378692bde2e3f18f" title="main" alt="" coords="540,5,591,32"/>
</map>
</div>

</div>
</div>
<a id="a45c9c768c2486ac046ac242d3c46aadb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a45c9c768c2486ac046ac242d3c46aadb">&#9670;&nbsp;</a></span>print_users()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void print_users </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structt__userlist.html">t_userlist</a> *&#160;</td>
          <td class="paramname"><em>list</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Print users nick and real name stored in a <a class="el" href="structt__userlist.html">t_userlist</a> doubly linked list </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">liste</td><td>the <a class="el" href="structt__userlist.html">t_userlist</a> to print </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="logs__helpers_8c_source.html#l00030">30</a> of file <a class="el" href="logs__helpers_8c_source.html">logs_helpers.c</a>.</p>

<p class="reference">References <a class="el" href="server_8h_source.html#l00117">t_userlist::next</a>.</p>

<p class="reference">Referenced by <a class="el" href="logs__helpers_8c_source.html#l00017">print_users_in_chans()</a>.</p>
<div class="fragment"><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;{</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        printf(<span class="stringliteral">&quot;\t\tUSERS LIST :\n&quot;</span>);</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        <span class="keywordflow">for</span> (<a class="code" href="structt__userlist.html">t_userlist</a> *tmp = list; tmp; tmp = tmp-&gt;<a class="code" href="structt__userlist.html#a3b987a9a352379a703da737198b42d4a">next</a>) {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;                printf(<span class="stringliteral">&quot;User : [%s], Real Name : [%s]\n&quot;</span>,</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;                tmp-&gt;user-&gt;nick, tmp-&gt;user-&gt;rname);</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        }</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;}</div><div class="ttc" id="structt__userlist_html"><div class="ttname"><a href="structt__userlist.html">t_userlist</a></div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00114">server.h:114</a></div></div>
<div class="ttc" id="structt__userlist_html_a3b987a9a352379a703da737198b42d4a"><div class="ttname"><a href="structt__userlist.html#a3b987a9a352379a703da737198b42d4a">t_userlist::next</a></div><div class="ttdeci">struct s_userlist * next</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00117">server.h:117</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="logs__helpers_8c_a45c9c768c2486ac046ac242d3c46aadb_icgraph.png" border="0" usemap="#logs__helpers_8c_a45c9c768c2486ac046ac242d3c46aadb_icgraph" alt=""/></div>
<map name="logs__helpers_8c_a45c9c768c2486ac046ac242d3c46aadb_icgraph" id="logs__helpers_8c_a45c9c768c2486ac046ac242d3c46aadb_icgraph">
<area shape="rect" id="node2" href="server_8h.html#a805324e4c542079956ff84a290274d23" title="print_users_in_chans" alt="" coords="140,5,285,32"/>
<area shape="rect" id="node3" href="server_8h.html#ac5949d17278df5e1ada98dca25ccd961" title="get_methods" alt="" coords="333,5,431,32"/>
<area shape="rect" id="node4" href="server__main_8c.html#a4178685c6a99dba7611faf9fe58f1a54" title="evhandler" alt="" coords="479,5,557,32"/>
<area shape="rect" id="node5" href="server__main_8c.html#a825c9cedc1751b000c44487b4233c37c" title="getactiveclients" alt="" coords="605,5,719,32"/>
<area shape="rect" id="node6" href="server__main_8c.html#af3e041546aaed3cd242c2b0e77162b39" title="server" alt="" coords="767,5,825,32"/>
<area shape="rect" id="node7" href="server__main_8c.html#a0c99d968a34e803d378692bde2e3f18f" title="main" alt="" coords="873,5,924,32"/>
</map>
</div>

</div>
</div>
<a id="a805324e4c542079956ff84a290274d23"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a805324e4c542079956ff84a290274d23">&#9670;&nbsp;</a></span>print_users_in_chans()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void print_users_in_chans </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structt__channel.html">t_channel</a> *&#160;</td>
          <td class="paramname"><em>chanlist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Print each channel in list with its users </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">chanlist</td><td>the channels doubly linked list </td></tr>
    <tr><td class="paramname">index</td><td>the received command index to avoid printing each time a PING cmd is received (too much log ;)) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="logs__helpers_8c_source.html#l00017">17</a> of file <a class="el" href="logs__helpers_8c_source.html">logs_helpers.c</a>.</p>

<p class="reference">References <a class="el" href="server_8h_source.html#l00125">t_channel::next</a>, <a class="el" href="server_8h_source.html#l00054">PING</a>, and <a class="el" href="logs__helpers_8c_source.html#l00030">print_users()</a>.</p>

<p class="reference">Referenced by <a class="el" href="commands__parsing_8c_source.html#l00073">get_methods()</a>.</p>
<div class="fragment"><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;{</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        <span class="keywordflow">if</span> (index != <a class="code" href="server_8h.html#abfa4cf7a25ca27eb109ef9065f30581fa3a95ef902bc659901cceef98e0bc8041">PING</a>) {</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;                <span class="keywordflow">for</span> (<a class="code" href="structt__channel.html">t_channel</a> *tmp = chanlist; tmp; tmp = tmp-&gt;<a class="code" href="structt__channel.html#ad735fa416150cd0bbd1ce42e82a1c1fa">next</a>) {</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;                        printf(<span class="stringliteral">&quot;\tChannel : [%s]\n&quot;</span>, tmp-&gt;channame);</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;                        <a class="code" href="logs__helpers_8c.html#a45c9c768c2486ac046ac242d3c46aadb">print_users</a>(tmp-&gt;users);</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;                }</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        }</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;}</div><div class="ttc" id="logs__helpers_8c_html_a45c9c768c2486ac046ac242d3c46aadb"><div class="ttname"><a href="logs__helpers_8c.html#a45c9c768c2486ac046ac242d3c46aadb">print_users</a></div><div class="ttdeci">void print_users(t_userlist *list)</div><div class="ttdef"><b>Definition:</b> <a href="logs__helpers_8c_source.html#l00030">logs_helpers.c:30</a></div></div>
<div class="ttc" id="structt__channel_html_ad735fa416150cd0bbd1ce42e82a1c1fa"><div class="ttname"><a href="structt__channel.html#ad735fa416150cd0bbd1ce42e82a1c1fa">t_channel::next</a></div><div class="ttdeci">struct s_channel * next</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00125">server.h:125</a></div></div>
<div class="ttc" id="structt__channel_html"><div class="ttname"><a href="structt__channel.html">t_channel</a></div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00121">server.h:121</a></div></div>
<div class="ttc" id="server_8h_html_abfa4cf7a25ca27eb109ef9065f30581fa3a95ef902bc659901cceef98e0bc8041"><div class="ttname"><a href="server_8h.html#abfa4cf7a25ca27eb109ef9065f30581fa3a95ef902bc659901cceef98e0bc8041">PING</a></div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00054">server.h:54</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="logs__helpers_8c_a805324e4c542079956ff84a290274d23_cgraph.png" border="0" usemap="#logs__helpers_8c_a805324e4c542079956ff84a290274d23_cgraph" alt=""/></div>
<map name="logs__helpers_8c_a805324e4c542079956ff84a290274d23_cgraph" id="logs__helpers_8c_a805324e4c542079956ff84a290274d23_cgraph">
<area shape="rect" id="node2" href="logs__helpers_8c.html#a45c9c768c2486ac046ac242d3c46aadb" title="print_users" alt="" coords="199,5,285,32"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="logs__helpers_8c_a805324e4c542079956ff84a290274d23_icgraph.png" border="0" usemap="#logs__helpers_8c_a805324e4c542079956ff84a290274d23_icgraph" alt=""/></div>
<map name="logs__helpers_8c_a805324e4c542079956ff84a290274d23_icgraph" id="logs__helpers_8c_a805324e4c542079956ff84a290274d23_icgraph">
<area shape="rect" id="node2" href="server_8h.html#ac5949d17278df5e1ada98dca25ccd961" title="get_methods" alt="" coords="199,5,296,32"/>
<area shape="rect" id="node3" href="server__main_8c.html#a4178685c6a99dba7611faf9fe58f1a54" title="evhandler" alt="" coords="344,5,423,32"/>
<area shape="rect" id="node4" href="server__main_8c.html#a825c9cedc1751b000c44487b4233c37c" title="getactiveclients" alt="" coords="471,5,584,32"/>
<area shape="rect" id="node5" href="server__main_8c.html#af3e041546aaed3cd242c2b0e77162b39" title="server" alt="" coords="632,5,691,32"/>
<area shape="rect" id="node6" href="server__main_8c.html#a0c99d968a34e803d378692bde2e3f18f" title="main" alt="" coords="739,5,789,32"/>
</map>
</div>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
